package com.woohua.thread.limite;

import org.springframework.web.client.RestTemplate;

/***
 * @title Requester
 * @description
 * @author woo hua
 * @version 1.0.0
 * @create 2023/3/14 10:24
 **/
public class Requester implements Runnable {

    private final String urlPath;

    private final RestTemplate restTemplate = new RestTemplate();

    public Requester(String urlPath) {
        this.urlPath = urlPath;
    }

    @Override
    public void run() {
        String response = restTemplate.getForEntity(urlPath, String.class).getBody();
        System.out.println("response: " + response);
    }
}
